import { defineStore } from 'pinia'
import {getinfo} from "@/api/manager"
export const useTestStore = defineStore('Test', {
    state: () => {
        return {
            data: 0,
            count:0,
            count2: 0,
            count3: 0,
            name: 'Eduardo',
        }
    },
     persist: {
  //这里存储默认使用的是session
    enabled: true,
    strategies: [
      { storage: sessionStorage, paths: ['data'] },
      { storage: localStorage, paths: ['name','count2'] },
    ]
  },
    getters:{

    },
    actions:{
        async setData(){
            this.data =await getinfo()
        }
    }
})